From 5936aedd3d853514a31ebece23175255fb2415c3 Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Mon, 31 Aug 2026 17:00:12 +1200 Subject: Initial commit --- app/insights/[slug]/page.tsx | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/insights/[slug]/page.tsx (limited to 'app/insights/[slug]') diff --git a/app/insights/[slug]/page.tsx b/app/insights/[slug]/page.tsx new file mode 100644 index 0000000..d654ff0 --- /dev/null +++ b/app/insights/[slug]/page.tsx @@ -0,0 +1,52 @@ +import type { Metadata } from "next"; +import Link from "next/link"; +import { notFound } from "next/navigation"; +import { Eyebrow, Section } from "@/components/section"; +import { posts } from "@/lib/content"; + +type Props = { params: Promise<{ slug: string }> }; + +export async function generateStaticParams() { + return posts.map((p) => ({ slug: p.slug })); +} + +export async function generateMetadata({ params }: Props): Promise { + const { slug } = await params; + const post = posts.find((p) => p.slug === slug); + if (!post) return { title: "Insight" }; + return { title: post.title, description: post.dek }; +} + +export default async function InsightPostPage({ params }: Props) { + const { slug } = await params; + const post = posts.find((p) => p.slug === slug); + if (!post) notFound(); + + return ( +
+ + ← Insights + + + {post.date} · {post.reading} + +

+ {post.title} +

+

+ {post.dek} +

+
+ {post.paragraphs.map((para) => ( +

{para}

+ ))} +
+

+ {post.tags.join(" · ")} +

+
+ ); +} -- cgit v1.2.3